const recursionRoutes = (allRoutes, menuList) => {
  let userRoutes = [];
  allRoutes.forEach(item => {
    menuList.forEach(v => {
      if (item.meta.name == v.name) {
        if (v.children && Array.isArray(v.children)) {
          item.children = recursionRoutes(item.children, v.children);
        }
        userRoutes.push(item);
      }
    });
  });
  return userRoutes;
};

export default recursionRoutes;
